package com.lnsf.bookstore.system.log.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.log.dao.LogMapper;
import com.lnsf.bookstore.system.log.service.LogService;
import com.lnsf.bookstore.system.log.vo.Log;
import com.lnsf.bookstore.system.order.vo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    public  PageInfo<Log> selectAll(Map<String, Object> map, Log log){
        PageHelper.startPage(Integer.parseInt(map.get("page").toString()),Integer.parseInt(map.get("limit").toString()));
        return new PageInfo<Log>(logMapper.selectAll());
    }

    @Override
    public int save(Log log) {
        return logMapper.insert(log);
    }
}
